<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
	<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
	<script src="${contextPath}/scripts/scriptvalidator.js" type="text/javascript"></script>
	<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
<title>二网审核</title>
</head>
<body>
<div class="navigation">
	    <span><a href="javascript:window.history.back();"><img src="${contextPath}/images/back_nav_btn.png" /></a>
	    <a href="javascript:window.history.back();">返回</a>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="javascript:window.location.reload();">刷新</a>
	    </span>盘库管理&gt;&gt;二网审核
    </div>
   <form name="form1" id="form1" method="post" action="">
	<div class="xt_main_right_center">
	  <table  width="100%" border="0" cellpadding="0" cellspacing="0"    style="border-color:#CCCCCC;">
	    <tr>
	      <td class="left-td-width-bg" align="right">金融机构：</td>
	      <td class="right-td-width-bg-left">${theNetwork.financial.name }</td>
	      <td class="left-td-width-bg">渠道：</td>
	      <td   align="left">${theNetwork.brand.name } </td>
	      <td class="left-td-width-bg"  align="right"> 销售店名：</td>
	      <td class="right-td-width-bg-left"  align="right">${theNetwork.shop.shopName } </td>
	    </tr>
	    <tr>
	      <td class="left-td-width-bg"  align="right">申请人：</td>
	      <td class="right-td-width-bg-left" >${theNetwork.creator } </td>
	      <td class="left-td-width-bg" >申请单号：</td>
	      <td  class="right-td-width-bg-left"  align="right">${theNetwork.theNumber } </td>
	      <td class="left-td-width-bg"  align="right">申请时间：</td>
	      <td class="right-td-width-bg-left"   align="right">${theNetwork.applicationDate }</td>
	    </tr>
	    <tr>
	      <td class="left-td-width-bg"  align="right">附件下载：</td>
	      <td colspan="5"  >
				<s:iterator value="attachs" >
					<div style="display: inline">
						<a href="${contextPath}/attach/download.do?id=<s:property value="id"/>" ><s:property value="name"/></a>&nbsp;<img name="img_del" id="<s:property value="id"/>" src="${contextPath}/images/del.gif" alt="删除" width="16" height="18" border="0" onclick="javascript:del(this,<s:property value="id"/>)" />
					</div>
				</s:iterator> 
		  </td>
	    </tr>
	    <tr>
	      <td class="left-td-width-bg"  align="right">申请列表：</td>
	      <td colspan="5"  >
	      <table width="100%" border="0" cellpadding="0" cellspacing="0">
	        <tr>
	          <td class="top-td-width-bg"><input name="checkbox1" type="checkbox" id="alla" >
	            全选/全不选 </td>
	          <td class="top-td-width-bg">序号</td>
	          <td class="top-td-width-bg">合格证号</td>
	          <td class="top-td-width-bg">车架号</td>
	          <td class="top-td-width-bg">车型</td>
	          <td class="top-td-width-bg">发动机号</td>
	          <td class="top-td-width-bg">供货价</td>
	          <td class="top-td-width-bg">回库地址</td>
	          <td class="top-td-width-bg">二网地址</td>
	          <td class="top-td-width-bg">审核状态</td>
	        </tr>
	         <s:iterator value="theNetwork.theNetworks" status="i" id="c">
	          <tr>
	            <td class="down-center-td-width-bg"><input type="checkbox" name="longId"  value="${c.id }"/></td>
	             <td class="down-center-td-width-bg">${i.count }</td>
	              <td class="down-center-td-width-bg">${c.certificationNum }</td>
	              <td class="down-center-td-width-bg">${c.chassis }</td>
	              <td class="down-center-td-width-bg">${c.motorcycleType }</td>
	              <td class="down-center-td-width-bg">${c.engine }</td>
	              <td class="down-center-td-width-bg"><s:property value="formatAmount(#c.supplyPrice)"/></td>
	              <td class="down-center-td-width-bg">${c.shopName }</td>
	              <td class="down-center-td-width-bg">${c.theAddress }</td>
	              <td class="down-center-td-width-bg">
	             ${c.isNotPass }</td>
	          </tr>
	          </s:iterator>
	      </table></td>
	    </tr>
	    <tr>
	      <td class="down-center-td-width-bg"  colspan="11" align="right"><%@ include file="/WEB-INF/view/common/pagination.jsp"%></td>
	    </tr>
	    <tr>
	      <td colspan="6" align="center" valign="middle">&nbsp;</td>
	    </tr>
	  </table>
	</div>
	  <input type="hidden" name="redirectUrl" value='<s:property value='redirectUrl'/>'/>
	   <input type="hidden" name="id" value='${theNetwork.id }'/>
	  <table width="1039" height="163" border="0" align="center">
	    <tr>
	      <td width="58" rowspan="2">备注 </td>
	      <td width="441" rowspan="2"><label>
	        <textarea name="msg" cols="30" rows="5" id="textfield"></textarea>
	      </label></td>
	      <td width="527" height="69">&nbsp;</td>
	    </tr>
	    <tr>
	      <td><input type="button" onClick="cao(1)" name="button" id="button" class="btn_pass" value="">
	      <input type="button" name="button2"  onClick="caoPass(2)" id="button2" class="btn_refuse"  value=""></td>
	    </tr>
	  </table>
	  <s:if test="workflow!=null&&workflow.operates!=null">
		<br/>
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		  <tr>
		    <td height="25" align="left"><font color="#0066CC"><strong>流程操作记录：</strong></font></td>
		    <td height="25" align="right">
		    </td>
		  </tr>
		</table> 
		<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
		  <tr> 
		    <td width="3%" class="top-td-width-bg">序号</td>
		    <td width="20%" class="top-td-width-bg">操作人</td>
		    <td width="20%" class="top-td-width-bg">操作类型</td>
		    <td width="40%" class="top-td-width-bg">描述</td>
		    <td width="17%" class="top-td-width-bg">操作时间</td>
		  </tr>
		 <s:iterator value="workflow.operates" status="stx" >
			<tr height="26" align="center" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';"> 
			 	<td align="center"><s:property value="#stx.index+1"/></td>
			    <td align="center"><s:property value="operater.realName"/></td>
			    <td align="center"><s:property value="type.name"/></td>
			    <td align="center"><s:property value="description"/></td>
			    <td align="center"><s:property value="operateDate"/></td>
			</tr>
		</s:iterator>
		</table>
		<br/>
	</s:if>
</form>

<br/><br/><br/><br/><br/>
		<div><jsp:include page="/include/footer.inc"></jsp:include></div>
</body>
<script language="javascript">
function cao(a){
	var fo=document.form1;
	var obj = document.getElementsByName("longId");
	var mol = false;
	for(var i=0; i<obj.length;i++){
		if(obj[i].checked){
			if(mol == false){
				fo.action="addVerify.do?caozuo="+a;
				fo.submit();
				mol = true;			
			}
			
		}
	}
	if(mol == false){
		alert("请选择通过数据");
	}
	
	}
function caoPass(a){
	var fo=document.form1;
	fo.action="addVerify.do?caozuo="+a;
	fo.submit();
}
//全选/全不选
$("#alla").change(function(){
    
    var bool = $(this).is(":checked");
    
    $("[name='longId']").each(function(){
        
        if(bool){
            
            $(this).attr("checked", "checked");
           
        }else{
            
            $(this).removeAttr("checked");
        }
        
        $(this).change();
    });
});
function del(e,id){
	if(confirm("附件操作不可恢复,确认删除吗?")){
		var f=false;
		$.ajax({
			  async:false,
			  type: 'POST',
			  url: "<s:property value='contextPath'/>/attach/del.do?id="+id,
			  dataType: "json",
			  success: function(data) {
					  	f = data.flag;
					  	if(f){
					  		//alert("删除成功");
					  		$(e).parent().remove();
					  	}
					}
				,
				error:function(data){
				}
			}); 
		
	}
	
}
</script>
</html>